/**
 * 视频相关操作
 * Created by zhangluxin on 2017/6/1.
 */
var AgoraUtil = {};

AgoraUtil.initVideoView = function (videoData) {
    if (cc.sys.os == cc.sys.OS_IOS) {
        jsb.reflection.callStaticMethod('AgoraUtil', 'initVideoView:', videoData);
    } else if (cc.sys.os == cc.sys.OS_ANDROID) {
        jsb.reflection.callStaticMethod(packageUri + '/utils/AgoraUtil', 'initVideoView', '(Ljava/lang/String;)V', videoData);
    }
};

AgoraUtil.openVideo = function (roomid, uid) {
    if (cc.sys.os == cc.sys.OS_IOS) {
        jsb.reflection.callStaticMethod('AgoraUtil', 'openVideo:uid:', roomid, uid);
    } else if (cc.sys.os == cc.sys.OS_ANDROID) {
        jsb.reflection.callStaticMethod(packageUri + '/utils/AgoraUtil', 'openVideo', '(Ljava/lang/String;Ljava/lang/String;)V', roomid, uid);
    }
};

AgoraUtil.hideAllVideo = function () {
    if (cc.sys.os == cc.sys.OS_IOS) {
        jsb.reflection.callStaticMethod('AgoraUtil', 'hideAllVideo');
    } else if (cc.sys.os == cc.sys.OS_ANDROID) {
        jsb.reflection.callStaticMethod(packageUri + '/utils/AgoraUtil', 'hideAllVideo', '()V');
    }
};

AgoraUtil.showAllVideo = function () {
    if (cc.sys.os == cc.sys.OS_IOS) {
        jsb.reflection.callStaticMethod('AgoraUtil', 'showAllVideo');
    } else if (cc.sys.os == cc.sys.OS_ANDROID) {
        jsb.reflection.callStaticMethod(packageUri + '/utils/AgoraUtil', 'showAllVideo', '()V');
    }
};

AgoraUtil.closeVideo = function () {
    if (cc.sys.os == cc.sys.OS_IOS) {
        jsb.reflection.callStaticMethod('AgoraUtil', 'closeVideo');
    } else if (cc.sys.os == cc.sys.OS_ANDROID) {
        jsb.reflection.callStaticMethod(packageUri + '/utils/AgoraUtil', 'closeVideo', '()V');
    }
};
